package com.weixinli.beans;

import java.io.Serializable;

public class PageInfo  implements Serializable{
	private static final long serialVersionUID = 1L;
	private Integer page;
	private Integer rows;

	public Integer getPage() {
		return (page-1)*rows;
	}
	public void setPage(Integer page) {
		this.page = page;
	}
	public Integer getRows() {
		return page*rows;
	}
	public void setRows(Integer rows) {
		this.rows = rows;
	}
	@Override
	public String toString() {
		return "PageInfo [page=" + page + ", rows=" + rows + "]";
	}
	public PageInfo(Integer page, Integer rows) {
		super();
		this.page = page;
		this.rows = rows;
	}
	public PageInfo() {
		super();
		// TODO Auto-generated constructor stub
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((page == null) ? 0 : page.hashCode());
		result = prime * result + ((rows == null) ? 0 : rows.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		PageInfo other = (PageInfo) obj;
		if (page == null) {
			if (other.page != null)
				return false;
		} else if (!page.equals(other.page))
			return false;
		if (rows == null) {
			if (other.rows != null)
				return false;
		} else if (!rows.equals(other.rows))
			return false;
		return true;
	}
	
	
}
